Skip to content

Potential fix for code scanning alert no. 13: Binding a socket to all network interfaces - #85

Merged
irino merged 1 commit into
masterfrom
alert-autofix-13
Nov 9, 2026
Merged

irino merged 1 commit into
masterfrom
alert-autofix-13

Conversation

@irino

@irino irino commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/irino/softflowd/security/code-scanning/13

Use loopback-only binding for the probe socket in run_nfdump_capture so the ephemeral port is allocated on a local interface only.

Best minimal fix (no behavior change intended):

  • In tools/softflowd_test_collector.py, function run_nfdump_capture, change:
    • probe.bind(("0.0.0.0", 0))
    • to probe.bind(("127.0.0.1", 0))

Why this is best:

  • Preserves existing logic (still asks OS for a free ephemeral UDP port).
  • Keeps behavior aligned with downstream use (-n 127.0.0.1:{port}).
  • Removes all-interface bind and resolves CodeQL finding.
  • Requires no new imports, helpers, or dependencies.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

… network interfaces

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@irino
irino marked this pull request as ready for review November 9, 2026 21:45
@irino
irino merged commit 3ae1676 into master Nov 9, 2026
58 of 60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant